<include file="Admin/Public/Header" />
<style type="text/css">
    .layui-layer-tips{width:auto !important;}
</style>
<script src="__SCRIPT__/common.js" type="text/javascript"></script>
<script src="__PUBLIC__/Layer/layer.js" type="text/javascript"></script>
<script src="__PUBLIC__/DatePicker/DatePicker.js" type="text/javascript"></script>
<link href="__PUBLIC__/DatePicker/Css/DatePicker.css" type="text/css" rel="stylesheet" />
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31"><div class="titlebt">订单查询</div></td>
    </tr>
</table>

<div class="main">
    <div class="operate">
        <div class="left_pad">
            <form id="search" method="post" action="__URL__/Index/">
                <!-- 筛选 -->
                <table>
                    <tr>
                        <td>
                            <label>订单号：<input type="text" name="sn" class="inp_default" value="{$search.sn}" placeholder="请输入订单号"></label>
                            <label>买家：<input type="text" name="buyer" class="inp_default" value="{$search.buyer}" placeholder="请输入买家用户名/手机号码"></label>
                            <label>卖家：<input type="text" name="seller" class="inp_default" value="{$search.seller}" placeholder="请输入卖家用户名/手机号码"></label>
                            <label>订单时间：<input type="text" class="inp_default" style="width:180px; text-align: center;" name="date" id="datePicker" readonly /></label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        状态筛选：
                        <foreach name="status" item="vo" key="key">
                            <label>
                                <input type="checkbox" class="status" name="status[]" value="{$key}" {$vo.checked} /> {$vo.text}
                            </label>
                            &nbsp;&nbsp;
                        </foreach>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="hidden" name="search" value="0" />
                            <input type="submit" class="btn_blue" value="查  询">
                            <if condition="$ShowClearStorageBtn === true">
                                <input type="button" class="btn_blue" onclick="location.href='{:U('Admin/Order/ClearStorageBtn')}'" value="批量取消支付超时订单">
                            </if>
                        </td>
                    </tr>
                </table>
                <script type="text/javascript">
                    var dateRange1 = new pickerDateRange('datePicker', {
                                isTodayValid: true,
                                aToday: 'aTodayDemo1', //今天
                                aRecent30Days: 'aRecent30DaysDemo1', //最近30天
                                aRecent90Days: 'aRecent90DaysDemo1', //最近90天
                                aRecent1Year: 'aRecent1YearDemo1',//最近1年
                            <empty name="start">
                            startDate: '{:date('Y-m-d', time()-2592000)}',
                            endDate: '{:date('Y-m-d', time())}',
                    <else />
                    startDate: '{$start}',
                            endDate:   '{$end}',
                    </empty>
                    needCompare: false,
                            target: 'searchForm',
                            defaultText: ' ~ ',
                            autoSubmit: true,
                            inputTrigger: 'datePicker',
                            theme: 'ta',
                            magicSelect: false,
                    });

                    $('#search').change(function(){
                        $('input[name="search"]').val(1);
                    });
                </script>
            </form>
        </div>
    </div>
    <div class="list">
            <table width="100%">
                <tr>
                    <th>订单号</th>
                    <th>买家</th>
                    <th>卖家</th>
                    <th>商品名称</th>
                    <th>订单金额</th>
                    <th>订单时间</th>
                    <th>买家支付宝账号</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>

                <empty name="list">
                    <tr>
                        <td colspan="9">本区域暂无数据显示...</td>
                    </tr>
                    <else />
                    <volist name='list' id='v'>
                        <tr>
                            <td>{$v.order_sn}</td>
                            <td>{$v.buyer_name}</td>
                            <td>{$v.seller_name}</td>
                            <td>{$v.goods_title}</td>
                            <td>{:order_amount($v['order_number'], $v['order_price'])}</td>
                            <td>{$v.order_time|date='Y-m-d H:i:s', ###}</td>
                            <td>{$v.buyer_alipay}</td>
                            <td>{$v.order_real_status|order_status=###}</td>
                            <td><a href="{:U('Admin/Order/Modify', array('sn'=>$v['order_sn']))}">订单操作</a></td>
                        </tr>
                    </volist>
                </empty>


            </table>
    </div>
    <div class="page">
        {$page}
    </div>

</div>
<include file="Public/Copyright" />
</body>
</html>
